package com.rongmei.jdsync.entity;

import javax.persistence.*;
import lombok.Data;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 商品详情实体类
 * @author dongjun
 */
@Data
@Entity
@Table(name = "jd_goods_detail")
public class GoodsDetail {

    @Id
    @Column(name = "goods_id", columnDefinition = "INT COMMENT '商品ID'")
    private Integer goodsId;

    @Column(name = "brand_id", columnDefinition = "INT COMMENT '品牌ID'")
    private Integer brandId;

    @Column(name = "brand_logo", length = 500, columnDefinition = "VARCHAR(500) COMMENT '品牌Logo URL'")
    private String brandLogo;

    @Column(name = "brand_name", length = 100, columnDefinition = "VARCHAR(100) COMMENT '品牌名称'")
    private String brandName;

    @Column(name = "category_id", columnDefinition = "BIGINT COMMENT '分类ID'")
    private Long categoryId;

    @Column(name = "cost_price", precision = 10, scale = 2, columnDefinition = "DECIMAL(10,2) COMMENT '成本价'")
    private BigDecimal costPrice;

    @Column(name = "delivery_type", columnDefinition = "INT COMMENT '配送方式'")
    private Integer deliveryType;

//    @Column(name = "goods_content", columnDefinition = "TEXT")
//    private String goodsContent;

    @Column(name = "goods_image", length = 1024, columnDefinition = "VARCHAR(1024) COMMENT '商品图片URL'")
    private String goodsImage;

    @Column(name = "goods_name", length = 200, columnDefinition = "VARCHAR(200) COMMENT '商品名称'")
    private String goodsName;

    @Column(name = "goods_service_ids", length = 200, columnDefinition = "VARCHAR(200) COMMENT '商品服务ID列表'")
    private String goodsServiceIds;

    @Column(name = "goods_source", columnDefinition = "INT COMMENT '商品来源'")
    private Integer goodsSource;

    @Column(name = "goods_state", columnDefinition = "INT COMMENT '商品状态'")
    private Integer goodsState;

    @Column(name = "goods_stock", columnDefinition = "INT COMMENT '商品库存'")
    private Integer goodsStock;

    @Column(name = "goods_type", columnDefinition = "INT COMMENT '商品类型'")
    private Integer goodsType;

    @Column(columnDefinition = "TEXT COMMENT '商品介绍'")
    private String introduction;

    @Column(name = "is_collect", columnDefinition = "TINYINT COMMENT '是否收藏'")
    private Integer isCollect;

    @Column(name = "is_makeups_goods", columnDefinition = "TINYINT COMMENT '是否美妆商品'")
    private Integer isMakeupsGoods;

    @Column(name = "is_sku", columnDefinition = "TINYINT COMMENT '是否有SKU'")
    private Integer isSku;

    @Column(name = "is_vip", columnDefinition = "TINYINT COMMENT '是否VIP商品'")
    private Integer isVip;

    @Column(length = 20, columnDefinition = "VARCHAR(20) COMMENT '纬度'")
    private String latitude;

    @Column(length = 20, columnDefinition = "VARCHAR(20) COMMENT '经度'")
    private String longitude;

    @Column(name = "main_image", length = 500, columnDefinition = "VARCHAR(500) COMMENT '主图片URL'")
    private String mainImage;


    @Column(name = "market_price", length = 20, columnDefinition = "VARCHAR(20) COMMENT '市场价'")
    private String marketPrice;

    @Column(length = 20, columnDefinition = "VARCHAR(20) COMMENT '价格'")
    private String price;

    @Column(name = "profit_ratio", length = 20, columnDefinition = "VARCHAR(20) COMMENT '利润率'")
    private String profitRatio;

    @Column(name = "promotion_addon", length = 500, columnDefinition = "VARCHAR(500) COMMENT '促销附加信息'")
    private String promotionAddon;

    @Column(name = "sale_num", columnDefinition = "INT COMMENT '销量'")
    private Integer saleNum;

    @Column(name = "service_phone", length = 50, columnDefinition = "VARCHAR(50) COMMENT '服务电话'")
    private String servicePhone;

    @Column(name = "site_id", columnDefinition = "INT COMMENT '站点ID'")
    private Integer siteId;

    @Column(name = "sku_id", columnDefinition = "BIGINT COMMENT 'SKU ID'")
    private Long skuId;

    @Column(columnDefinition = "INT COMMENT '来源'")
    private Integer source;

    @Column(name = "start_sale_time", columnDefinition = "BIGINT COMMENT '开售时间戳'")
    private Long startSaleTime;

    @Column(length = 20, columnDefinition = "VARCHAR(20) COMMENT '单位'")
    private String unit;

    @Column(name = "video_url", length = 500, columnDefinition = "VARCHAR(500) COMMENT '视频URL'")
    private String videoUrl;

    @Column(name = "vip_price", precision = 10, scale = 2, columnDefinition = "DECIMAL(10,2) COMMENT 'VIP价格'")
    private BigDecimal vipPrice;


    @CreationTimestamp
    @Column(name = "created_at", updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间'")
    private LocalDateTime createdAt;

    @UpdateTimestamp
    @Column(name = "updated_at", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间'")
    private LocalDateTime updatedAt;
}